$compactHeaderHeight: 4rem;
$tabPadX: 2rem;
$tabPadY: 3rem;
$tabPadTopY: 1.5rem;
$sectionBorder: 1px solid var(--fill-2);

aside {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
}
.aside-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 14rem;
  height: 100%;
  padding: 4rem 1rem 1rem;
  border: solid var(--fill-5);
  border-width: 0 1px 0 0;
  @media (prefers-color-scheme: dark) {
    border-color: var(--fill-3);
  }
  background: var(--fill-0-5);
  img {
    width: 5rem;
    height: 5rem;
  }
  hr {
    width: 100%;
    border-color: inherit;
  }
}
.aside-menu-item {
  font-size: 1rem;
  font-weight: 500;
  a {
    display: block;
    padding-top: .6rem;
    padding-bottom: .6rem;
    color: var(--fill-8);
    white-space: nowrap;
    &.active,
    &:hover {
      color: var(--fg);
    }
  }
  [data-num-scripts="0"]::before {
    visibility: hidden;
  }
  [data-num-scripts] {
    &::before {
      content: '(' attr(data-num-scripts) ')';
      width: 5.5ch;
      align-self: center;
      text-align: right;
      margin-right: .5ch;
    }
  }
  &:nth-last-child(2) {
    flex: 1;
  }
  &:last-child {
    font-size: .8em;
  }
}
.text-red {
  color: red;
}
.text-upper {
  text-transform: uppercase;
}
section {
  padding: 0 0 $tabPadY;
  > h3 {
    background: linear-gradient(to right, var(--hbg, var(--fill-1)), transparent);
    border-top: $sectionBorder;
    line-height: 2;
    padding: 0 $tabPadX;
    margin: 0 calc(-1 * $tabPadX);
    margin-bottom: calc($tabPadY * .75) !important;
  }
  > h4 {
    margin-bottom: .3rem;
  }
  > p {
    margin-bottom: .3rem;
  }
}
textarea:not([rows="1"]):not(.h100) {
  resize: vertical;
  min-height: 2em;
  max-height: 50vh;
}
@media (min-width: 1440px) {
  .tab-settings[data-show-advanced=true] {
    columns: 2;
    column-gap: calc(2 * $tabPadX);
    details {
      break-inside: avoid;
    }
  }
}
.tab {
  position: relative;
  margin-left: 14rem;
  padding: $tabPadTopY $tabPadX 0;
  // overflow-y: auto;
  background: var(--bg);
}

.vl-modal {
  z-index: 3000;
}

.in-out {
  &-appear-from,
  &-enter-from,
  &-leave-to {
    > .modal-content {
      transform: translateY(-120%);
    }
    > .vl-modal-backdrop {
      opacity: 0;
    }
  }
  &-appear-active,
  &-enter-active,
  &-leave-active {
    &,
    > .modal-content {
      transition: transform .5s;
    }
    > .vl-modal-backdrop {
      transition: opacity .5s;
    }
  }
}

@media (max-width: 767px) {
  .page-options {
    flex-direction: column;
  }
  .tab {
    width: auto !important;
    margin: 0;
  }
  aside {
    position: sticky;
    bottom: auto;
  }
  .aside-content {
    flex-direction: row;
    align-items: center;
    width: auto;
    height: $compactHeaderHeight;
    padding: 0;
    border-width: 0 0 1px 0;
    overflow: auto hidden;
    img {
      width: calc($compactHeaderHeight - 8px);
      height: calc($compactHeaderHeight - 8px);
      margin: 0 .5rem;
      flex: 0 0 auto;
    }
    hr {
      display: none;
    }
    h1 {
      align-self: center;
      font-size: 1.25rem;
      margin: 0;
    }
  }
  .aside-menu-item {
    padding: 0 8px;
    a {
      display: flex;
      white-space: normal;
    }
  }
}

.bright {
  --hbg: bisque;
}

@media (prefers-color-scheme: dark) {
  .bright {
    --hbg: #880088; /* active badge color */
  }
}
